import request from '@/service/request'

//获取全部聊天室
export function getChatsRequest(inquiry: boolean) {
  return request.get('/room/page', {
    params: {
      inquiry,
    },
  })
}

//获取卖家的聊天室
export function getSellerChat(seller_id: boolean) {
  return request.get(`/room/info/${seller_id}`)
}

//消息列表
export function getChatList(roomId: string, cursor: string) {
  return request.post(`/chat/page`, {
    roomId,
    cursor: cursor || '',
  })
}
//发送消息
export function sentMes(roomId: string, msgType: number, content: any) {
  return request.post(`/chat/msg`, {
    roomId,
    msgType,
    body: { content: content },
  })
}
